package com.tbit.main.service.impl;

import com.tbit.main.dao.core.HelmetAbnormalDao;
import com.tbit.main.pojo.HelmetAbnormal;
import com.tbit.main.service.HelmetAbnormalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author LMY
 * @create 2022-10-11 20:14
 */
@Service
public class HelmetAbnormalServiceImpl implements HelmetAbnormalService {

    @Autowired
    private HelmetAbnormalDao helmetAbnormalDao;


    @Override
    public List<HelmetAbnormal> getMachineId(Integer machineId) {
        return helmetAbnormalDao.getMachineId(machineId);
    }

    @Override
    public HelmetAbnormal getMachineIdType(Integer machineId, Integer type) {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("machineId", machineId);
        params.put("type", type);
        return helmetAbnormalDao.getMachineIdType(params);
    }

    @Override
    public void insert(HelmetAbnormal helmetAbnormal) {
        helmetAbnormalDao.insert(helmetAbnormal);
    }

    @Override
    public void del(Integer machineId, Integer type) {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("machineId", machineId);
        params.put("type", type);
        helmetAbnormalDao.del(params);
    }

    @Override
    public void delId(Integer machineId) {
        helmetAbnormalDao.delId(machineId);
    }
}
